package com.beauty.product.repository;

import com.beauty.product.entity.ProductImage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface ProductImageRepository extends JpaRepository<ProductImage, Long> {
    
    List<ProductImage> findByProductId(String productId);
    
    List<ProductImage> findByProductIdOrderBySort(String productId);
    
    Optional<ProductImage> findByProductIdAndIsCover(String productId, Boolean isCover);
    
    void deleteByProductId(String productId);
} 